#pragma once
#include "Stdafx.h"
#include "Decal.h"
#include "Sprite.h"

namespace Pulpy
{
	class DecalSystem
	{
	private:
		int _MaxDecal;
		int _CurrentIndex;
		float _DefaultLife;
		Decal * _DecalList;
		Sprite * _DecalSprites;
		float _FilterDistance;
	public:
		DecalSystem(): _MaxDecal(0), _DefaultLife(0),_CurrentIndex(0),_FilterDistance(0) { }
		DecalSystem(int max, float life, float filterDist, unsigned short row, unsigned short col, char * filename): _MaxDecal(max),
			_DefaultLife(life),_CurrentIndex(0), _FilterDistance(filterDist)
		{ 
			_DecalList = new Decal[max]; 
			_DecalSprites = new Sprite(col, row, filename);
		}
		~DecalSystem() { delete [] _DecalList; delete _DecalSprites; }
		void draw(const Vector3D<float> &v);
		void addDecal(float w, float h, unsigned char index, const Vector3D<float> &v = Vector3D<float>());
	};
}
